<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="zTakeinList" checkbox="false" pagination="true" fitColumns="true" title="客户信息" pageSize="100" onLoadSuccess="cb"
    actionUrl="XianJinController.do?datagrid&key=${key}&type=${type}&key2=${key2}" idField="id" sortName="createDate" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人登录名称"  field="createBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate"  formatter="yyyy-MM-dd"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人名称"  field="updateName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新日期"  field="updateDate"  formatter="yyyy-MM-dd"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="客户姓名"  field="customName"  query="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="入金时间"  field="takeinTime" formatter="yyyy-MM-dd"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="电话"  field="phone"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="汇款账号"  field="bankAccount"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="到期时间"  field="endTime" formatter="yyyy-MM-dd" queryMode="group" query="true" width="120" formatterjs="daoqi"></t:dgCol>
   <t:dgCol title="合计金额(元)"  field="interest"  queryMode="single"  width="120" align="right"></t:dgCol>
   <t:dgCol title="客户签字"  field="ext2"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="备注"  field="comment"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="到期日"  field="endTime2" formatterjs="getEnd" queryMode="single"  width="100" align="right"></t:dgCol>
   <t:dgCol title="是否打印"  field="print"  queryMode="single" hidden="true" width="100" align="right"></t:dgCol>
   <t:dgCol title="操作" field="opt"></t:dgCol>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   <t:dgFunOpt funname="goud2(id)" title="修改"  urlclass="ace_button"  urlfont="fa-edit"></t:dgFunOpt>
   <t:dgFunOpt funname="goPrint(id)" title="打印凭证"  urlclass="ace_button"  urlfont="fa-edit"></t:dgFunOpt>
  </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 });

 function cb(data) {
   $(data.rows).each(function(i, t) {
     if("1"==t.print) {
         $($($(".datagrid-btable")[1]).find("tr")[i]).css("color", "red");
     }
  });
 }

 function daoqi(value,row,index) {
     if(value) return value.substring(0, 10);
     return "活期";
 }

 function getEnd(value,row,index) {
     if(row["endTime"]) return row["endTime"].substring(8, 10);
     return row["takeinTime"].substring(0, 10);
 }

 function goud2(id) {
     createwindow('修改', 'zTakeinController.do?goUpdate&id='+id , 768, null);
 }

 function goPrint(id) {
     createwindow('打印凭证', 'zTakeinController.do?goPrint&id='+id+'&pname='+this.name, 768, null);
 }
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'zTakeinController.do?upload', "zTakeinList");
}

//导出
function ExportXls() {
	JeecgExcelExport("XianJinController.do?exportXls&key=${key}&type=${type}&key2=${key2}","zTakeinList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("zTakeinController.do?exportXlsByT","zTakeinList");
}

//bootstrap列表图片格式化
function btListImgFormatter(value,row,index){
	return listFileImgFormat(value,"image");
}
//bootstrap列表文件格式化
function btListFileFormatter(value,row,index){
	return listFileImgFormat(value);
}

</script>
